const http = require('http');

const server = http.createServer((req, res) => {
  // 定义要返回的数组
  const data = [
    { value: 1, label: 'Alice' },
    { value: 2, label: 'Bob' },
  ];

  // 设置响应头为 JSON 格式
  res.writeHead(200, { 'Content-Type': 'application/json' });
  // 返回数组的 JSON 字符串
  res.end(JSON.stringify(data));
});

server.listen(3070, () => {
  console.log('Server running at http://localhost:3070');
});